function even(num) {
  let total = 0
  for (let j = 0; j <= num; j++) {
    if (j % 2 == 0) {
      total += j
    }
  }
  return total
}

function add_fraction(num) {
  let total = 0
  for (let i = 1; i <= num; i++) {
    if (i % 2 == 0) {
      total -= 1 / i
    } else {
      total += 1 / i
    }
  }
  return total
}
function add_prime(a, b) {
  if (a > b) {
    let c = a
    a = b
    b = c
  }
  for (let i = a; i <= b; i++) {
    let count = 0
    for (let j = 1; j <= i; j++) {
      if (i % j == 0) {
        count += 1
      }
    }
    if (count <= 2) {
      console.log(`${i}是个质数。`)
    }
  }
}

function same_find(a, b) {
  for (let i = a; i <= b; i++) {
    let flag = true
    let str = String(i)
    let before = str[0]
    if (str.length == 1) {
      flag = false
    }
    for (let j = 1; j < str.length; j++) {
      if (str[j] != before) {
        flag = false
        break
      }
      before = str[j]
    }
    flag ? console.log(i) : null
  }
}
same_find(10000, 100000)

function arg_output(){
     if(arguments.length==3){
        let min = arguments[0]
        let max = arguments[0]
        let middle =arguments[0]
        for(let i=0;i<arguments.length;i++){
             if(arguments[i]<min){
                 min=arguments[i]
             }
             if(arguments[i]>max){
                max = arguments[i]
             }
        }
        for(let i=0 ;i<arguments.length;i++){
            if(arguments[i]<max&&arguments[i]>min ){
                middle =arguments[i]
            }
        }
        console.log(max,min,middle);

     }
}

arg_output(3,2,1)